package sc;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Image;

public class SeperatorPanel extends BasePanel
{
	private static final long serialVersionUID = 1L;
	private final static Font nameFont;

	static
	{
		nameFont = new Font("SansSerif", Font.PLAIN, 14);
	}
	
	private String name;

	public SeperatorPanel(String name, String sortvalue)
	{
		this.name = name;
		setPreferredSize(new Dimension(100, 20));
		sortValue(sortvalue);
	}
    
	@Override
	public void paintComponent(Graphics g)
    {
		int w = getWidth();
		TopPanel.update();
		
		// Tile the background image
		Image bg = Images.getImage("/images/panel.png");
		for (int x = 0; x < w; x += 37)
			g.drawImage(bg, x, 0, this);
		
		g.setFont(nameFont);
		g.setColor(Color.BLACK);
		g.drawString(name, 5, 15);
	}

}
